package com.itheima.chapter08.set.TreeSet;

import java.util.TreeSet;
//Comparable按照年龄排序
public class Comparabledemo {
    public static void main(String[] args) {
        TreeSet ts =new TreeSet<>();
        Student s1 =new Student("zhangsan ",23);
        Student s2 =new Student("lisi ",30);
        Student s3 =new Student("zhaoliu",29);
        Student s4 =new Student("wangwu",29);
        ts.add(s1);
        ts.add(s2);
        ts.add(s3);
        ts.add(s4);
        System.out.println(ts);
    }
}
